#!/bin/sh -e

# Will store the built package's files to
# allow us to cherry-pick the ICU related files.
mkdir -p tmp
export DESTDIR="$PWD/tmp"

cl-meson \
    -Dglib=enabled \
    -Dicu=enabled \
    -Dicu_builtin=false \
    -Dbenchmark=disabled \
    -Dcairo=disabled \
    -Ddocs=disabled \
    -Dtests=disabled \
    . output

ninja -C output
ninja -C output install

# Install library files
clinst -Dm644 -t "$1/usr/lib/pkgconfig"    tmp/usr/lib/pkgconfig/harfbuzz-icu.pc
cp -H tmp/usr/lib/libharfbuzz-icu* "$1/usr/lib/"

# Install header
clinst -Dm644 -t "$1/usr/include/harfbuzz" tmp/usr/include/harfbuzz/hb-icu.h
